Skip to content

Fix git init with core.hidedotfiles - #131

Closed
dscho wants to merge 1 commit into
gitgitgadget:masterfrom
dscho:unhidden-git
Closed

dscho wants to merge 1 commit into
gitgitgadget:masterfrom
dscho:unhidden-git

Conversation

@dscho

@dscho dscho commented Feb 24, 2019 •

Copy link
Copy Markdown
Member

This fixes an regression that was not present in Git for Windows's original core.hideDotFiles patch, but in the shape of the core.hideDotFiles patch that made it into git.git.

We fixed it in one big hurry in Git for Windows, and I simply forgot to upstream this right away.

Changes since v1:

  • Clarified in the code comment that our intention is to pick up core.hidedotfiles in the first git_config() call.
  • Explained in the commit message why we cannot remove the git_config(git_init_db_config, NULL) call from create_default_files(): it would cause a change of behavior with regard to the init.templatedir setting.
  • Simplified the test case.

@dscho dscho added the ready to submit Has commits that have not been submitted yet label Feb 24, 2019
@dscho dscho mentioned this pull request Feb 25, 2019
35 tasks done
@dscho

dscho commented Mar 7, 2019

Copy link
Copy Markdown
Member Author

/submit

@dscho dscho removed the ready to submit Has commits that have not been submitted yet label Mar 7, 2019
@gitgitgadget

gitgitgadget Bot commented Mar 7, 2019

Copy link
Copy Markdown

Submitted as pull.131.git.gitgitgadget@gmail.com

Comment thread builtin/init-db.c Resolved
This is a brown paper bag. When adding the tests, we actually failed
to verify that the config variable is heeded in git-init at all. And
when changing the original patch that marked the .git/ directory as
hidden after reading the config, it was lost on this developer that
the new code would use the hide_dotfiles variable before the config
was read.

The fix is obvious: read the (limited, pre-init) config *before*
creating the .git/ directory.

Please note that we cannot remove the identical-looking `git_config()`
call from `create_default_files()`: we create the `.git/` directory
between those calls. If we removed it, and if the parent directory is
in a Git worktree, and if that worktree's `.git/config` contained any
`init.templatedir` setting, we would all of a sudden pick that up.

This fixes git-for-windows#789

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho

dscho commented Mar 11, 2019

Copy link
Copy Markdown
Member Author

/submit

@gitgitgadget

gitgitgadget Bot commented Mar 11, 2019

Copy link
Copy Markdown

Submitted as pull.131.v2.git.gitgitgadget@gmail.com

@gitgitgadget

gitgitgadget Bot commented Mar 12, 2019

Copy link
Copy Markdown

This branch is now known as js/init-db-update-for-mingw.

@gitgitgadget

gitgitgadget Bot commented Mar 12, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@b2b8028.

@gitgitgadget gitgitgadget Bot added the pu label Mar 12, 2019
@gitgitgadget

gitgitgadget Bot commented Mar 13, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@e907134.

@gitgitgadget

gitgitgadget Bot commented Mar 14, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@244a95b.

@gitgitgadget

gitgitgadget Bot commented Mar 18, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@980d11e.

@gitgitgadget

gitgitgadget Bot commented Mar 19, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@bc7ca16.

@gitgitgadget

gitgitgadget Bot commented Mar 20, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@521a344.

@gitgitgadget

gitgitgadget Bot commented Mar 20, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@d0a9f6c.

@gitgitgadget

gitgitgadget Bot commented Apr 1, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@cb17ca7.

@gitgitgadget

gitgitgadget Bot commented Apr 4, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@597fe3f.

@gitgitgadget

gitgitgadget Bot commented Apr 10, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@e539234.

@gitgitgadget

gitgitgadget Bot commented Apr 10, 2019

Copy link
Copy Markdown

This patch series was integrated into next via git@1d57688.

@gitgitgadget gitgitgadget Bot added the next label Apr 10, 2019
@gitgitgadget

gitgitgadget Bot commented Apr 16, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@6364386.

@gitgitgadget

gitgitgadget Bot commented Apr 16, 2019

Copy link
Copy Markdown

This patch series was integrated into next via git@6364386.

@gitgitgadget

gitgitgadget Bot commented Apr 16, 2019

Copy link
Copy Markdown

This patch series was integrated into master via git@6364386.

@gitgitgadget gitgitgadget Bot added the master label Apr 16, 2019
@gitgitgadget gitgitgadget Bot closed this Apr 16, 2019
@gitgitgadget

gitgitgadget Bot commented Apr 16, 2019

Copy link
Copy Markdown

Closed via 6364386.

@dscho
dscho deleted the unhidden-git branch April 17, 2019 12:28
gitgitgadget Bot pushed a commit that referenced this pull request Dec 7, 2025
Update clar to commit 39f11fe (Merge pull request #131 from
pks-gitlab/pks-integer-double-evaluation, 2025-12-05). This commit
includes the following changes relevant to Git:

  - There are now typesafe integer comparison functions. Furthermore,
    the range of comparison functions has been included to also have
    relative comparisons, like "greater than".

  - There is a new `cl_failf()` macro that allows the caller to specify
    an error message with formatting directives.

  - The TAP format has been fixed to correctly terminate YAML blocks
    with "...\n" instead of "---\n".

Note that we already had a `cl_failf()` function declared in our own
sources. This function is equivalent to the upstreamed function, so we
can simply drop it now.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant